<template>
	<view class="container">
		<view style="width: 100%;height: 20rpx;"></view>
		<view class="list_view" v-if="deviceType=='LOCK'" v-for="(item, index) in dataList" :key="index">
			<view class="item_view">
				<view class="left_view">
					锁具名称
				</view>
				<view class="right_view">
					{{ item.deviceName }}
				</view>
			</view>
			<view class="item_view">
				<view class="left_view">
					ID
				</view>
				<view class="right_view">
					{{ item.deviceNo }}
				</view>
			</view>
			<view class="item_view">
				<view class="left_view">
					车站
				</view>
				<view class="right_view">
					{{ item.tenantName }}
				</view>
			</view>
			<view class="item_view">
				<view class="left_view">
					区域
				</view>
				<view class="right_view">
					{{ item.area }}
				</view>
			</view>
			<view class="item_view">
				<view class="left_view">
					安装位置
				</view>
				<view class="right_view">
					{{ item.location }}
				</view>
			</view>
		</view>

		<view class="door_list_view" v-if="deviceType=='DOOR'" v-for="(item, index) in dataList" :key="index">
			<view class="door_item_view">
				<view class="Text33">
					{{ item.deviceName }}
				</view>
			</view>
			<view class="door_item_view">
				<view class="left_view">
					车站
				</view>
				<view class="right_view">
					{{ item.tenantName }}
				</view>
			</view>
			<view class="door_item_view">
				<view class="left_view">
					区域
				</view>
				<view class="right_view">
					{{ item.area }}
				</view>
			</view>
			<view class="door_item_view">
				<view class="left_view">
					安装位置
				</view>
				<view class="right_view">
					{{ item.location }}
				</view>
			</view>
			<view class="door_item_view">
				<view class="left_view">
					状态
				</view>
				<view class="right_view">
					{{ statusEnum(item.status) }}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		components: {},
		data() {
			return {
				id: '',
				deviceType: '',
				dataList: [],
			}
		},
		onLoad() {
			this.id = this.$Route.query.id
			this.deviceType = this.$Route.query.deviceType
			this.getAuthorizeApplyDetailData()
		},
		methods: {
			statusEnum(e) {
				switch (e) {
					case 1:
						return '在线'
					case 2:
						return '离线'
					default:
						break
				}
			},
			getAuthorizeApplyDetailData() {
				var that = this
				this.$apis.getAuthorizeApplyDetail(this.id).then(result => {
					if (result.res.data.code == '200') {
						that.dataList = result.res.data.data;
						console.log(222222, that.dataList);
					} else {
						that.$show.toastMessage(result.res.data.msg);
					}
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.container {
		width: 100%;
		min-height: 100vh;
		box-sizing: border-box;
		background-color: #F8F8F8;
	}

	.list_view {
		border-top: 1rpx solid #E8E8E8;

		.item_view {
			display: flex;
			flex-direction: row;
			justify-content: space-between;
			align-items: center;
			padding: 30rpx;
			background-color: #FFFFFF;
			border-bottom: 1rpx solid #E8E8E8;

		}
	}

	.door_list_view {
		background-color: #FFFFFF;
		margin: 20rpx;
		border-radius: 20rpx;
		padding: 20rpx 0;

		.door_item_view {
			display: flex;
			flex-direction: row;
			justify-content: space-between;
			align-items: center;
			padding: 10rpx 30rpx;
			color: #333333;
		}
	}

	.bottom_view {
		width: 100%;
		height: 120rpx;
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		display: flex;
		flex-direction: row;
		justify-content: space-around;
		align-items: center;
		background-color: #FFFFFF;

		.again_view {
			width: 40%;
			height: 80rpx;
			color: #324DEC;
			border: 1px solid #324DEC;
			display: flex;
			justify-content: center;
			align-items: center;
			border-radius: 40rpx;
		}

		.next_view {
			width: 50%;
			height: 80rpx;
			background-color: #324DEC;
			display: flex;
			justify-content: center;
			align-items: center;
			color: #FFFFFF;
			border-radius: 40rpx;
		}
	}
</style>